int hanluota(int n,char a,char b,char c){
    if(n==1){
        printf("将第1个盘子从%c移动到%c\n",a,c);
    }
    else{
        hanluota(n-1,a,c,b);
        printf("将第%d个盘子从%c移动到%c\n",n,a,c);
        hanluota(n-1,b,a,c);
    }
     return 0;
}
int main(){
 int n;
     printf("请输入汉诺塔的层数：");
   scanf("%d",&n);
hanluota(n,'A','B','C');
   return 0;
}